package com.sxbbc.seller.controller;

import com.function.common.GetRest;
import com.function.common.RestResponse;
import com.sxbbc.common.core.entity.jz.Address;
import com.sxbbc.common.core.service.IAddressService;
import com.sxbbc.seller.common.MappingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 地址
 *
 * @author leehao
 * @date 2019-05-28 22:27
 */
@Controller
public class AddressController {

    @Autowired
    private IAddressService addressService;

    @RequestMapping(value = MappingUtils.QUERY_ADDRESS_NOPAGE)
    @ResponseBody
    public RestResponse queryAddressNoPage(@RequestParam String pid, Address address){
        address.setPid(Integer.parseInt(pid));
        List<Address> allList = addressService.queryAddressByParentId(address);
        return GetRest.getSuccess("",allList);
    }
}
